home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 3671 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: news.ov.com!news
  2. From: glenn@ov.com (Fletcher.Glenn@ov.com)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: a dump question from a novice C programme
  5. Date: 30 Jan 1996 16:37:16 GMT
  6. Organization: OpenVision
  7. Message-ID: <4elhfs$puj@spanky.pls.ov.com>
  8. References: <jyli-2801960040100001@li.gsfc.nasa.gov>
  9. Reply-To: glenn@ov.com
  10. NNTP-Posting-Host: foghorn.pls.ov.com
  11.  
  12. In article 2801960040100001@li.gsfc.nasa.gov, jyli@climate.gsfc.nasa.gov (Jason Li) writes:
  13. >
  14. >I have just started programming in C, still feel dizzy sometimes when
  15. >looking at cryptic C code.  Occasionally I come across code like this: 
  16. >
  17. >for (iv=0; iv < specp->nlvars; iv++)
  18. >
  19. >what does this symbol "->" mean? I've looked all over my C books,  could
  20. >not find anything on it. 
  21. >
  22. >
  23. >Thanks in advance
  24. >
  25. >-- 
  26. >Jason Li                         |  Email:jyli@climate.gsfc.nasa.gov
  27. >Climate and Radiation Branch     |  Tel: (301) 286 1029             
  28. >NASA Goddard Space Flight Center |  Fax: (301) 286 1759   
  29. >Greenbelt, MD 20771   U.S.A.     |  WWW: http://climate.gsfc.nasa.gov
  30.  
  31.  
  32. The '->' means access the value of a member of a struct using a pointer
  33. to that struct.  In the case of the above example, the following two
  34. lines are exact equivalents (guess which is easier to type):
  35.  
  36. specp->nlvars
  37. (*specp).nlvars
  38.  
  39. See K+R2 pg. 131
  40.  
  41.             Fletcher.Glenn@ov.com
  42.  
  43.  
  44.